package com.gec.teams.wechat.common;

import jdk.nashorn.internal.objects.annotations.Property;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * 功能：线程保存token
 * 作者：YumTea
 * 日期：2024/6/14 10:48
 */

@Component
public class ThreadLocalToken {
    private ThreadLocal<String> local=new ThreadLocal<>();

    public void setToken(String token){
        local.set(token);
    }

    public String getToken(){
        return local.get();
    }

    public void clear(){
        local.remove();
    }
}